package cn.cmcc.intertelecom.controller;

import java.net.PasswordAuthentication;
import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;

import cn.cmcc.intertelecom.bean.Daily;
import cn.cmcc.intertelecom.bean.Msg;
import cn.cmcc.intertelecom.service.DailyService;
import cn.cmcc.intertelecom.utils.ArchivesLog;

/**
 * 用于日志的增删改查业务
 * @author wp
 *
 */

@Controller
public class DailyController {
	@Autowired
	private DailyService dailyService;
	
	@ArchivesLog(operationPower="query_daily")
	@ResponseBody
	@RequestMapping(value="/daily/{pn}")
	public Msg queryDaily(@PathVariable("pn")Integer pn,Daily daily){
		//显示第pn页  每页5个
		PageHelper.startPage(pn, 5);
		List<Daily> list=dailyService.selectAllWithOther(daily);
		PageInfo<Daily> pageInfo=new PageInfo<>(list);
		
		return Msg.success().add("pageInfo", pageInfo);
	}
	
}
